<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f = "http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="./BannersAndMenusTemplate.jsf">

            <ui:define name="content">
                <p:panel header="AcademicSet's Refernces">  

                    <h:form rendered="#{user.login}">  

                        <p:dataTable id="dataTable5" var="Reference" value="#{user.allSetReferences}" widgetVar="GPUsTable"   
                                     emptyMessage="No Author found with given criteria" 
                                     selection="#{user.selectedSetReference}" selectionMode="single"  rowKey="#{Reference.id}"> 

                            <f:facet name="footer">   

                                <p:commandButton  value="Remove" icon="ui-icon-close"
                                                  action = "#{user.removeSelectedSetReference}"/>   

                            </f:facet>     

                            <p:column     
                                       headerText="Title"  
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.title}" />   </p:column> 

                            <p:column  
                                       headerText="Year"  
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.rYear}" />  </p:column> 

                            <p:column    
                                       headerText="Type of reference"   
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.type}" />   

                            </p:column>  


                        </p:dataTable> 

                    </h:form>


                </p:panel>
                <p:panel header="All References">  

                    <h:form rendered="#{user.login}">  

                        <p:dataTable id="dataTableForViewSets" var="Reference" value="#{user.allReferences}" widgetVar="Reference"   
                                     emptyMessage="No Sets found with given criteria" 
                                     selection="#{user.selectedReferenceInsideSet}" selectionMode="single"  rowKey="#{Reference.id}"
                                     paginator="true" rows="10" rowsPerPageTemplate="5,10,15" lazy="false"  
                                     paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" >   
                              

                            <f:facet name="footer">     

                                <p:commandButton  id="showDialogButtonasdasdasdasda" value="Add" icon="ui-icon-pencil"  
                                                  action = "#{user.addReferenceToSet}" ajax="false"/>    





                            </f:facet>    


                            <p:column  filterBy="#{Reference.title}"   
                                       headerText="Title"  
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.title}" />   </p:column> 

                            <p:column  filterBy="#{Reference.rYear}"   
                                       headerText="Year"  
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.rYear}" />  </p:column> 

                            <p:column  filterBy="#{Reference.type}"   
                                       headerText="Type of reference"   
                                       filterMatchMode="contains">  
                                <h:outputText value="#{Reference.type}" />   

                            </p:column>  

                        </p:dataTable> 

                    </h:form>


                </p:panel> 
            </ui:define>

        </ui:composition>
    </h:body>
</html>

